<template>
	 <!-- style="opacity: 0.5;" -->
	<view class="hongbaoView" @click="clickRed" :style="{opacity:comitem.content_text[0].r_p.my_status == 1 || comitem.content_text[0].r_p.red_status == '2' || comitem.content_text[0].r_p.red_status == '1'?'0.5':'1'}">
		<view class="hongbaoCentent">
			<view>
				<image src="/static/chat/hongbaoIcon.png" style="width: 76rpx;height: 83rpx;"></image>
			</view>
			<view class="hongbaoCentent__textView">
				<text class="u-line-1">{{comitem.content_text[0].r_p.remark}}</text>
				<text style="font-size: 26rpx;" v-if="comitem.content_text[0].r_p.my_status == 1">
				    {{ $t('chat.msg.redPacketStatus.received') }}
				</text>
				<text style="font-size: 26rpx;" v-else-if="comitem.content_text[0].r_p.red_status == '2'">
				    {{ $t('chat.msg.redPacketStatus.receivedAllByUser') }}
				</text>
				<text style="font-size: 26rpx;" v-else-if="comitem.content_text[0].r_p.red_status == '1'">
				    {{ $t('chat.msg.redPacketStatus.expired') }}
				</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	export default {
		name: "chat-red-packet",
		props: {
			item: {
				type: Object,
				default: function() {
					return {}
				}
			},
		},
		computed: {
			comitem() {
				return this.item; // 依赖于 props
			},
			...mapState({
				user_info: state => state.user.user_info,
			}),
		},
		data() {
			return {
			};
		},
		mounted() {
			
		},
		methods: {
			clickRed(){
				this.$emit('clickRed',this.item)
			},
		},
	}
</script>

<style lang="scss">
	.hongbaoView{
		width: 480rpx;
		height: 180rpx;
		background-image: url("../../static/chat/hongbaomian.png");
		background-size: 100% 100%;
	}
	.hongbaoCentent{
		display: flex;
		align-items: center;
		padding: 30rpx;
		color: #ffffff;
		font-size: 32rpx;
		&__textView{
			display: flex;
			flex-direction: column;
			margin-left: 30rpx;
		}
	}
</style>